using System.Collections.ObjectModel;
using MaxAlarm.AlarmActions;

namespace MaxAlarm
{
    public class WaitQueueManager
    {
        #region Singletone

        private static readonly object _locker = new object();
        private static WaitQueueManager _instance;

        public static WaitQueueManager Instance
        {
            get
            {
                lock (_locker)
                {
                    return _instance ?? (_instance = new WaitQueueManager());
                }
            }
        }

        #endregion

        public ObservableCollection<CheckAfterAlarmAction> QueuedAlarms { get; protected set; }

        private WaitQueueManager()
        {
            QueuedAlarms = new ObservableCollection<CheckAfterAlarmAction>();
        }

        public void Queue(CheckAfterAlarmAction alarm)
        {
            QueuedAlarms.Add(alarm);
        }

        public void Dequeue(CheckAfterAlarmAction alarm)
        {
            QueuedAlarms.Remove(alarm);
        }
    }
}
